#!/usr/bin/env python

import os, sys
os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'
import settings
from gtfs.models import *
import datetime

if __name__ == '__main__':
    code = sys.argv[1]
    stop = Stop.objects.get(code=code)
    print stop.name
    for stop_time, route in stop.timetable(datetime.date.today()):
        print str(seconds_to_time(stop_time.arrival_time)) + "   " + route.short_name + " " + route.long_name

